package com.apes.fn.server.vehicleFile.model;

import com.apes.fn.server.transferVehicle.model.InnerPickDeliveryUpCar;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @program: apes-server
 * @description: 车辆档案区域 (省份)
 * @author: czs
 * @create: 2023-11-02 11:25
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = VehicleFileAreaItem.CONST_TABLE_NAME)
public class VehicleFileAreaItem extends Model {
    public static final String CONST_TABLE_NAME = "fn_vehicle_file_area_item";


    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "车辆档案区域明细编码", padding = 12)
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "vehicle_file_area_id", referencedColumnName = "id")
    @Comment("车辆档案区域")
    private VehicleFileArea vehicleFileArea;

    public void setApiAddress(String apiAddress) {
        this.apiAddress = apiAddress.trim();
    }

    @Column(name = "api_address", length = 128,nullable = false)
    @Comment("接口地址")
    private String apiAddress;

    @Column(name = "remark", length = 64)
    @Comment("说明")
    private String remark;

    @Column(name = "api_type", length = 32)
    @Comment("接口类型")
    private String apiType;

}
